/**
 * Created by mapbar_front on 2019/8/5.
 */
import React,{Component} from 'react';

const RefHocPublic = (WrappedComponent)=>{
    class A extends Component {
        constructor(props) {
            super(props);
        }
        render() {
            const {forwardedRef, ...rest} = this.props;
            return (
                <div>
                    <h1>这是一个高阶组件</h1>
                    <WrappedComponent ref={forwardedRef}>
                        WrappedComponent
                    </WrappedComponent>
                </div>
            )
        }
    }
    return A;
    // return React.forwardRef((props,ref)=>{
    //     return <A {...props} forwardedRef={ref} />
    // })
}

export default RefHocPublic;
